package com.rftennis.web.controller.spring;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.rftennis.dto.JSONResponce;
import com.rftennis.exception.RftennisException;



@ControllerAdvice
public class AllExceptionHandler {
	
	@ExceptionHandler
	public @ResponseBody JSONResponce handle(RftennisException e) {
		return JSONResponce.fail(e.getMessage());
	}
	@ExceptionHandler
	public @ResponseBody JSONResponce handle(Exception e) {
		e.printStackTrace();
		return JSONResponce.fail("系统好累好累");
	}
}
